import time
from loguru import logger

# from service.dev_service import get_cvinfo_by_station_name
# from schema.cv import DevInfo

from cv.image.BaseImg import BaseImg
from cv.filter.filter import Filter
from cv.classify.classify_th import ClassifyTH
from cv.classify.classify_state import ClassifyState


# async def handle_long_camera(station,img)->bool:
#     if int(station.split("LM")[1])>=100: # 如果站点的编号大于等于，则该站点不是机台
#         logger.info('当前站点不是机台站点')
#         return False

#     # 根据站点获取机台信息
#     # dev_info:DevInfo = await get_cvinfo_by_station_name(station)
#     # baseimg = BaseImg(dev_info=dev_info,img_raw=img)
#     # baseimg.ocr_img()
#     # baseimg.ocr_blur_img()
#     # baseimg.ocr_scale()
#     # baseimg.highlight_ocr()
#     # baseimg.log_ocr()
#     logger.debug('-------------------------------------------------')
#     # filter = Filter(baseimg.ocr_raw_list)
#     filter.filter_temp_humi()
#     filter.filter_base()
#     filter.log_filter_ocr_yellow(filter.ocr_temp_humi_list)
#     # baseimg.highlight_ocr(filter.ocr_temp_humi_list)
#     cfy = ClassifyTH(ocr_raw_list=filter.ocr_temp_humi_list,ocr_base_list=filter.ocr_base_list)
#     flag = cfy.classfiy()
#     cfy.log_info()
#     logger.debug('=======================================')
#     return flag



# async def handle_short_camera(station,img)->bool:
#     if int(station.split("LM")[1])>=100: # 如果站点的编号大于等于，则该站点不是机台
#         logger.info('当前站点不是机台站点')
#         return False

#     # 根据站点获取机台信息
#     dev_info:DevInfo = await get_cvinfo_by_station_name(station)
#     baseimg = BaseImg(dev_info=dev_info,img_raw=img)
#     baseimg.ocr_img()
#     baseimg.log_ocr()
#     filter = Filter(baseimg.ocr_raw_list)
#     filter.filter_pure_chinese()
#     filter.log_filter_ocr_yellow()

#     baseimg.highlight_ocr(filter.ocr_filter_list)
#     cfy = ClassifyState(ocr_raw_list=filter.ocr_filter_list)
#     cfy.classify()
#     cfy.is_continue()



 